package main.Q1501_1600;

public class Q1511_1520 {
    public static void main(String[] args) {
        System.out.println("Question1511：");
        System.out.println("Question1512：好数对的数目");
        System.out.println("Question1513：");
        System.out.println("Question1514：");
        System.out.println("Question1515：");
        System.out.println("Question1516：");
        System.out.println("Question1517：");
        System.out.println("Question1518：换水问题");
        System.out.println("Question1519：");
        System.out.println("Question1520：");
    }
}

class Question1512{
    public int numIdenticalPairs(int[] nums) {
        int count=0;
        for (int i=0;i<nums.length;i++) {
            for (int j=i+1;j<nums.length;j++) {
                if (nums[i]==nums[j]) count++;
            }
        }
        return count;
    }
}

class Question1518{
    public int numWaterBottles(int numBottles, int numExchange) {
        int count=numBottles;
        int curBottles=numBottles;
        while (curBottles/numExchange>0) {
            count+=curBottles/numExchange;
            curBottles=curBottles/numExchange+curBottles%numExchange;
        }
        return count;
    }
}